﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using snat.model;

namespace algorithms.algorithms.Agent
{
    public class NaiveNode : AgentNode {

        double receivedDonations = 0;

        public NaiveNode(int id, String name)
            : base(id, name) { }

        public override void Donate() {
            //Naive agent donates to everyone every time...

            // Look through all nodes in the network as AgentNodes
            foreach (AgentNode node in NetworkModel.Instance.Nodes.Values) {
                // Donate to all that aren't themselves
                if (node != this) {
                    node.ReceiveDonation(100, this);
                }
            }
        }

        public override void ReceiveDonation(double amount, AgentNode sender) {
            //receive the donation from a node, just add it to the donations pot
            receivedDonations += amount;
        }
    }
}
